﻿
Imports doan_1065019_1065001.AppSettingsWriter

Public Class frmCapNhatThamSo
    Public username As String = ""
    Private Sub TrangChủToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrangChủToolStripMenuItem.Click
        Me.Close()
    End Sub

    Private Sub bntSoQuan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntSoQuan.Click
        Dim soquan As String = txtSoQuan.Text
        Try
            Integer.Parse(soquan)
            Dim w As AppSettingsWriter = New AppSettingsWriter()
            w.SetValue("SoQuanToiDa", soquan)
        Catch ex As Exception
            MessageBox.Show("Số quận là một số")
        End Try

    End Sub

    Private Sub btnSoDaiLy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSoDaiLy.Click
        Dim sodaily As String = txtSoDaiLy.Text
        Try
            Integer.Parse(sodaily)
            Dim w As AppSettingsWriter = New AppSettingsWriter()
            w.SetValue("SoCongTyToiDaMoiQuan", sodaily)
        Catch ex As Exception
            MessageBox.Show("Số công ty tối đa mỗi quận là một số")
        End Try
    End Sub

    Private Sub frmCapNhatThamSo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txtSoQuan.Text = AppSettingsWriter.GetValue("SoQuanToiDa")
        txtSoDaiLy.Text = AppSettingsWriter.GetValue("SoCongTyToiDaMoiQuan")
        txtSoLoaiNha.Text = AppSettingsWriter.GetValue("SoLoaiNha")
    End Sub

    Private Sub SoLoaiNha_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SoLoaiNha.Click
        Dim soloainha As String = txtSoLoaiNha.Text
        Try
            Integer.Parse(soloainha)
            Dim w As AppSettingsWriter = New AppSettingsWriter()
            w.SetValue("SoLoaiNha", soloainha)
        Catch ex As Exception
            MessageBox.Show("Số loại nhà là số")
        End Try
    End Sub
End Class